/**
 * <copyright>
 * </copyright>
 *
 * $Id$
 */
package BoardGameToTreeIntegration.impl;

import BoardGame.BoardGamePackage;

import BoardGameToTreeIntegration.BoardGameToTreeIntegrationFactory;
import BoardGameToTreeIntegration.BoardGameToTreeIntegrationPackage;
import BoardGameToTreeIntegration.BoardToFile;
import BoardGameToTreeIntegration.BoardToNode;
import BoardGameToTreeIntegration.FieldToNode;
import BoardGameToTreeIntegration.FigureToNode;

import BoardGameToTreeIntegration.Rules.RulesPackage;

import BoardGameToTreeIntegration.Rules.impl.RulesPackageImpl;

import GameRules.GameRulesPackage;

import MocaTree.MocaTreePackage;

import TGGRuntime.TGGRuntimePackage;

import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EPackage;
import org.eclipse.emf.ecore.EReference;

import org.eclipse.emf.ecore.impl.EPackageImpl;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model <b>Package</b>.
 * <!-- end-user-doc -->
 * @generated
 */
public class BoardGameToTreeIntegrationPackageImpl extends EPackageImpl
		implements BoardGameToTreeIntegrationPackage {
	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private EClass boardToFileEClass = null;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private EClass fieldToNodeEClass = null;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private EClass figureToNodeEClass = null;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private EClass boardToNodeEClass = null;

	/**
	 * Creates an instance of the model <b>Package</b>, registered with
	 * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package
	 * package URI value.
	 * <p>Note: the correct way to create the package is via the static
	 * factory method {@link #init init()}, which also performs
	 * initialization of the package, or returns the registered package,
	 * if one already exists.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see org.eclipse.emf.ecore.EPackage.Registry
	 * @see BoardGameToTreeIntegration.BoardGameToTreeIntegrationPackage#eNS_URI
	 * @see #init()
	 * @generated
	 */
	private BoardGameToTreeIntegrationPackageImpl() {
		super(eNS_URI, BoardGameToTreeIntegrationFactory.eINSTANCE);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private static boolean isInited = false;

	/**
	 * Creates, registers, and initializes the <b>Package</b> for this model, and for any others upon which it depends.
	 * 
	 * <p>This method is used to initialize {@link BoardGameToTreeIntegrationPackage#eINSTANCE} when that field is accessed.
	 * Clients should not invoke it directly. Instead, they should simply access that field to obtain the package.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #eNS_URI
	 * @see #createPackageContents()
	 * @see #initializePackageContents()
	 * @generated
	 */
	public static BoardGameToTreeIntegrationPackage init() {
		if (isInited)
			return (BoardGameToTreeIntegrationPackage) EPackage.Registry.INSTANCE
					.getEPackage(BoardGameToTreeIntegrationPackage.eNS_URI);

		// Obtain or create and register package
		BoardGameToTreeIntegrationPackageImpl theBoardGameToTreeIntegrationPackage = (BoardGameToTreeIntegrationPackageImpl) (EPackage.Registry.INSTANCE
				.get(eNS_URI) instanceof BoardGameToTreeIntegrationPackageImpl ? EPackage.Registry.INSTANCE
				.get(eNS_URI) : new BoardGameToTreeIntegrationPackageImpl());

		isInited = true;

		// Initialize simple dependencies
		GameRulesPackage.eINSTANCE.eClass();

		// Obtain or create and register interdependencies
		RulesPackageImpl theRulesPackage = (RulesPackageImpl) (EPackage.Registry.INSTANCE
				.getEPackage(RulesPackage.eNS_URI) instanceof RulesPackageImpl ? EPackage.Registry.INSTANCE
				.getEPackage(RulesPackage.eNS_URI) : RulesPackage.eINSTANCE);

		// Create package meta-data objects
		theBoardGameToTreeIntegrationPackage.createPackageContents();
		theRulesPackage.createPackageContents();

		// Initialize created meta-data
		theBoardGameToTreeIntegrationPackage.initializePackageContents();
		theRulesPackage.initializePackageContents();

		// Mark meta-data to indicate it can't be changed
		theBoardGameToTreeIntegrationPackage.freeze();

		// Update the registry and return the package
		EPackage.Registry.INSTANCE.put(
				BoardGameToTreeIntegrationPackage.eNS_URI,
				theBoardGameToTreeIntegrationPackage);
		return theBoardGameToTreeIntegrationPackage;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EClass getBoardToFile() {
		return boardToFileEClass;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EReference getBoardToFile_Source() {
		return (EReference) boardToFileEClass.getEStructuralFeatures().get(0);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EReference getBoardToFile_Target() {
		return (EReference) boardToFileEClass.getEStructuralFeatures().get(1);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EClass getFieldToNode() {
		return fieldToNodeEClass;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EReference getFieldToNode_Source() {
		return (EReference) fieldToNodeEClass.getEStructuralFeatures().get(0);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EReference getFieldToNode_Target() {
		return (EReference) fieldToNodeEClass.getEStructuralFeatures().get(1);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EClass getFigureToNode() {
		return figureToNodeEClass;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EReference getFigureToNode_Source() {
		return (EReference) figureToNodeEClass.getEStructuralFeatures().get(0);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EReference getFigureToNode_Target() {
		return (EReference) figureToNodeEClass.getEStructuralFeatures().get(1);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EClass getBoardToNode() {
		return boardToNodeEClass;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EReference getBoardToNode_Source() {
		return (EReference) boardToNodeEClass.getEStructuralFeatures().get(0);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EReference getBoardToNode_Target() {
		return (EReference) boardToNodeEClass.getEStructuralFeatures().get(1);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public BoardGameToTreeIntegrationFactory getBoardGameToTreeIntegrationFactory() {
		return (BoardGameToTreeIntegrationFactory) getEFactoryInstance();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private boolean isCreated = false;

	/**
	 * Creates the meta-model objects for the package.  This method is
	 * guarded to have no affect on any invocation but its first.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void createPackageContents() {
		if (isCreated)
			return;
		isCreated = true;

		// Create classes and their features
		boardToFileEClass = createEClass(BOARD_TO_FILE);
		createEReference(boardToFileEClass, BOARD_TO_FILE__SOURCE);
		createEReference(boardToFileEClass, BOARD_TO_FILE__TARGET);

		fieldToNodeEClass = createEClass(FIELD_TO_NODE);
		createEReference(fieldToNodeEClass, FIELD_TO_NODE__SOURCE);
		createEReference(fieldToNodeEClass, FIELD_TO_NODE__TARGET);

		figureToNodeEClass = createEClass(FIGURE_TO_NODE);
		createEReference(figureToNodeEClass, FIGURE_TO_NODE__SOURCE);
		createEReference(figureToNodeEClass, FIGURE_TO_NODE__TARGET);

		boardToNodeEClass = createEClass(BOARD_TO_NODE);
		createEReference(boardToNodeEClass, BOARD_TO_NODE__SOURCE);
		createEReference(boardToNodeEClass, BOARD_TO_NODE__TARGET);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private boolean isInitialized = false;

	/**
	 * Complete the initialization of the package and its meta-model.  This
	 * method is guarded to have no affect on any invocation but its first.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void initializePackageContents() {
		if (isInitialized)
			return;
		isInitialized = true;

		// Initialize package
		setName(eNAME);
		setNsPrefix(eNS_PREFIX);
		setNsURI(eNS_URI);

		// Obtain other dependent packages
		RulesPackage theRulesPackage = (RulesPackage) EPackage.Registry.INSTANCE
				.getEPackage(RulesPackage.eNS_URI);
		TGGRuntimePackage theTGGRuntimePackage = (TGGRuntimePackage) EPackage.Registry.INSTANCE
				.getEPackage(TGGRuntimePackage.eNS_URI);
		BoardGamePackage theBoardGamePackage = (BoardGamePackage) EPackage.Registry.INSTANCE
				.getEPackage(BoardGamePackage.eNS_URI);
		MocaTreePackage theMocaTreePackage = (MocaTreePackage) EPackage.Registry.INSTANCE
				.getEPackage(MocaTreePackage.eNS_URI);

		// Add subpackages
		getESubpackages().add(theRulesPackage);

		// Create type parameters

		// Set bounds for type parameters

		// Add supertypes to classes
		boardToFileEClass.getESuperTypes().add(
				theTGGRuntimePackage.getAbstractCorrespondence());
		fieldToNodeEClass.getESuperTypes().add(
				theTGGRuntimePackage.getAbstractCorrespondence());
		figureToNodeEClass.getESuperTypes().add(
				theTGGRuntimePackage.getAbstractCorrespondence());
		boardToNodeEClass.getESuperTypes().add(
				theTGGRuntimePackage.getAbstractCorrespondence());

		// Initialize classes, features, and operations; add parameters
		initEClass(boardToFileEClass, BoardToFile.class, "BoardToFile",
				!IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
		initEReference(getBoardToFile_Source(), theBoardGamePackage.getBoard(),
				null, "source", null, 1, 1, BoardToFile.class, !IS_TRANSIENT,
				!IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES,
				!IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
		initEReference(getBoardToFile_Target(), theMocaTreePackage.getFile(),
				null, "target", null, 1, 1, BoardToFile.class, !IS_TRANSIENT,
				!IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES,
				!IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);

		initEClass(fieldToNodeEClass, FieldToNode.class, "FieldToNode",
				!IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
		initEReference(getFieldToNode_Source(), theBoardGamePackage.getField(),
				null, "source", null, 1, 1, FieldToNode.class, !IS_TRANSIENT,
				!IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES,
				!IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
		initEReference(getFieldToNode_Target(), theMocaTreePackage.getNode(),
				null, "target", null, 1, 1, FieldToNode.class, !IS_TRANSIENT,
				!IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES,
				!IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);

		initEClass(figureToNodeEClass, FigureToNode.class, "FigureToNode",
				!IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
		initEReference(getFigureToNode_Source(),
				theBoardGamePackage.getFigure(), null, "source", null, 1, 1,
				FigureToNode.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE,
				!IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE,
				!IS_DERIVED, IS_ORDERED);
		initEReference(getFigureToNode_Target(), theMocaTreePackage.getNode(),
				null, "target", null, 1, 1, FigureToNode.class, !IS_TRANSIENT,
				!IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES,
				!IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);

		initEClass(boardToNodeEClass, BoardToNode.class, "BoardToNode",
				!IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
		initEReference(getBoardToNode_Source(), theBoardGamePackage.getBoard(),
				null, "source", null, 1, 1, BoardToNode.class, !IS_TRANSIENT,
				!IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES,
				!IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
		initEReference(getBoardToNode_Target(), theMocaTreePackage.getNode(),
				null, "target", null, 1, 1, BoardToNode.class, !IS_TRANSIENT,
				!IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES,
				!IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);

		// Create resource
		createResource(eNS_URI);
	}

} //BoardGameToTreeIntegrationPackageImpl
